﻿using System;

namespace TSB.FarmPowerShellWizard.Entities
{
    public enum CrawlScheduleTypes { None, Daily, Weekly, Monthly}
    [Flags]
    public enum DaysOfWeekTypes
    {
        NA = 0,
        Friday = 0x20,
        Monday = 2,
        Saturday = 0x40,
        Sunday = 1,
        Thursday = 0x10,
        Tuesday = 4,
        Wednesday = 8,
    }

    [Flags]
    public enum MonthsOfYearTypes
    {
        NA = 0,
        April = 8,
        August = 0x80,
        December = 0x800,
        February = 2,
        January = 1,
        July = 0x40,
        June = 0x20,
        March = 4,
        May = 0x10,
        November = 0x400,
        October = 0x200,
        September = 0x100

    }
    public class SearchCrawlSchedule
    {
        public CrawlScheduleTypes CrawlScheduleType;
        public int RunEveryInterval;
        public int RepeatInterval;
        public int RepeatDuration;
        public DateTime CrawlStartTime;
        public string Description;
        public DaysOfWeekTypes DaysOfWeek;
        public MonthsOfYearTypes MonthsOfYear;
        public int DaysOfWeekTotal
        {
            get { return (int) DaysOfWeek; }
        }
        public int MonthsOfYearTotal
        {
            get { return (int)MonthsOfYear; }
        }
    }
}
